#define _CRT_SECURE_NO_WARNINGS 1

#include"List.h"

ListTest1()
{
	ListNode* plist = ListCreate();
	ListPushBack(plist, 1);
	ListPushBack(plist, 2);
	ListPushBack(plist, 3);
	ListPushBack(plist, 4);
	ListPrint(plist);

	ListPopBack(plist);
	ListPrint(plist);

	ListPopBack(plist);
	ListPrint(plist);

	ListPopBack(plist);
	ListPrint(plist);
	
	ListPopBack(plist);
	ListPrint(plist);

	ListPrint(plist);


	ListDestory(plist);
	plist = NULL;


}
ListTest2()
{
	ListNode* plist = ListCreate();

	ListPushFront(plist,1);
	ListPushFront(plist, 2);
	ListPushFront(plist, 3);
	ListPushFront(plist, 4);

	ListPrint(plist);
	ListPopFront(plist);
	ListPrint(plist);

	ListPopFront(plist);
	ListPrint(plist);
	ListPopFront(plist);
	ListPrint(plist);
	ListPopFront(plist);
	ListPrint(plist);


}
ListTest3()
{
	ListNode* plist = ListCreate();
	ListPushBack(plist, 1);
	ListPushBack(plist, 2);
	ListPushBack(plist, 3);
	ListPushBack(plist, 4);
	ListPrint(plist);

	ListNode* pos1 = ListFind(plist, 2);
	ListInsert(pos1, 5);
	ListPrint(plist);

	
	ListNode* pos2 = ListFind(plist, 4);
	ListInsert(pos2, 6);
	ListPrint(plist);

	ListNode* pos3 = ListFind(plist, 3);
	ListErase(pos3, 3);
	ListPrint(plist);

}

int main()
{
	ListTest3();
	//ListTest2();
	//ListTest3();
	//ListTest4();
	return 0;
}